package com.mgvlife.ddlw.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "tb_schedule")
public class Schedule {
	@Id
	@Column(length = 36, name = "id", unique = true)
	private String id;
	@OneToOne(targetEntity = Course.class)
	private Course course;
	private String clazzTime;
	@ManyToMany(targetEntity = Clazz.class, fetch = FetchType.LAZY)
	private List<Clazz> clazzs;
	@OneToMany(targetEntity = SignInInfo.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private List<SignInInfo> signInInfos;
	// 签到状态，0尚未开始签到，1已开启签到
	private int status;
	@OneToOne(targetEntity = Admin.class)
	private Admin admin;
	@OneToOne(targetEntity = SignInFile.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private SignInFile signInFile;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public String getClazzTime() {
		return clazzTime;
	}

	public void setClazzTime(String clazzTime) {
		this.clazzTime = clazzTime;
	}

	public List<Clazz> getClazzs() {
		return clazzs;
	}

	public void setClazzs(List<Clazz> clazzs) {
		this.clazzs = clazzs;
	}

	public List<SignInInfo> getSignInInfos() {
		return signInInfos;
	}

	public void setSignInInfos(List<SignInInfo> signInInfos) {
		this.signInInfos = signInInfos;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Admin getAdmin() {
		return admin;
	}

	public void setAdmin(Admin admin) {
		this.admin = admin;
	}

	public SignInFile getSignInFile() {
		return signInFile;
	}

	public void setSignInFile(SignInFile signInFile) {
		this.signInFile = signInFile;
	}

}
